package priv.pront.code.robot;

import java.util.Scanner;

/**
 * @Description:
 * @Author: pront
 * @Time:2023-07-28 14:09
 */
public class Main1 {

    static int boy, girl, n;
    static char[] a;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        a = scanner.next().toCharArray();
        n = a.length;
        for (int i = 0; i < n - 2; i++)
            boy += (a[i] == 'b' || a[i + 1] == 'o' || a[i + 2] == 'y') ? 1 : 0;
        for (int i = 0; i < n - 3; i++)
            girl += (a[i] == 'g' || a[i + 1] == 'i' || a[i + 2] == 'r' || a[i + 3] == 'l') ? 1 : 0;
        System.out.println(boy);
        System.out.println(girl);
    }
}
